package com.quartz;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

public class Client {

	public static void main(String[] args) {
		
		JobDetail detail = new JobDetail();
		detail.setClass(TestJob.class);
		detail.setId("testJob");
		detail.setName("testJob");
		Map<String,String> params = new HashMap<String,String>();
		detail.setParams(params);
		
		JobTrigger trigger = new JobTrigger();
		trigger.setJobId("testJob");
		trigger.setJobName("testJob");
		trigger.setNextFireTime(new Date());
		

		Scheduler scheduler = SchedulerFactory.getScheduler();
		
		scheduler.schedule(detail, trigger);
		
		scheduler.start();
	}
}

class TestJob implements Job{

	@Override
	public void execute(JobContext context) throws JobExecuteException {
		// TODO Auto-generated method stub
		System.out.println("======"+ new Date());
	}
	
}